﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace PServiceBus.WebAPI.Transports {
    internal class SSETransport : BaseHttpTransport {

        private readonly long _messageID = DateTime.Now.Ticks;

        internal override string ContentType {
            get { return "text/event-stream"; }
        }

        protected override void Write(string json) {
            Writer.Write(String.Format("id: {0}\ndata: {1}\n\n", _messageID, json));
        }
    }
}
